<template>

    <el-menu :default-openeds="['1', '3']" style="min-height: 100%; overflow-x: hidden"
             background-color="rgb(48, 65, 86)"
             text-color="#fff"
             active-text-color="#ffd04b"
             :collapse-transition="false"
             :collapse="isCollapse"
             :default-active="path"
             router

    >
        <div style="height: 60px; line-height: 60px; text-align: center">
           <h1 style="color: white">后台面板</h1>
        </div>
      <!--  <el-menu-item index="/echarts">

                <i class="el-icon-s-home"></i>
                <span slot="title">大数据面板</span>

        </el-menu-item>
        &lt;!&ndash;<el-submenu index="2">&ndash;&gt;
           &lt;!&ndash; <template slot="title">
                <i class="el-icon-menu"></i>
                <span slot="title">系统管理</span>
            </template>&ndash;&gt;
            <el-menu-item index="/person">
                <i class="el-icon-s-custom"></i>
                <span slot="title">用户管理</span>
            </el-menu-item>
            <el-menu-item index="/file">
                <i class="el-icon-upload"></i>
                <span slot="title">文件管理</span>
            </el-menu-item>
        <el-menu-item index="/articless">
            <i class="el-icon-document"></i>
            <span slot="title">文章管理</span>
        </el-menu-item>
        <el-menu-item index="/role">
        <i class="el-icon-document"></i>
        <span slot="title">角色管理</span>
    </el-menu-item>
        <el-menu-item index="/userRole">
            <i class="el-icon-document"></i>
            <span slot="title">用户角色</span>
        </el-menu-item>
        <el-menu-item index="/permission">
            <i class="el-icon-document"></i>
            <span slot="title">权限菜单</span>
        </el-menu-item>
        <el-menu-item index="/sign">
            <i class="el-icon-success"></i>
            <span slot="title">签到记录</span>
        </el-menu-item>
        <el-menu-item index="/report">
            <i class="el-icon-warning"></i>
            <span slot="title">举报记录</span>
        </el-menu-item>
        <el-menu-item index="/info">
            <i class="el-icon-document"></i>
            <span slot="title">登录信息</span>
        </el-menu-item>-->
        <el-menu-item :index="item.path" v-for="item in user.permissions" :key="item.id">
            <i :class="item.icon"></i>
            <span slot="title">{{item.comment}}</span>
        </el-menu-item>
        <!--</el-submenu>-->
    </el-menu>
</template>

<script>
    export default {
        name: "Aside",
       data(){
           return {
               path: this.$route.path , //设置高亮
               user:{}
           }
       },
        props: {
            isCollapse: Boolean,
            logoTextShow: Boolean
        },
        created(){
            let userStr=sessionStorage.getItem("user")
            this.user=JSON.parse(userStr)


        },
        methods: {
            handlerSelect(index) {
                console.log(index)
                console.log(this.$router.options.routes) //打印所有路由
            },
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }
</script>

<style scoped>

</style>
